package com.project.class8_18;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class MyTest {

    public static void main(String[] args) {
        Class c = MyObj.class;
        try {
//            Object obj = c.getConstructor().newInstance();
//            System.out.println(obj);
//            Object obj = c.newInstance();
//            System.out.println(obj);
            Method m = c.getDeclaredMethod("speak");
            int x = m.getModifiers();
            System.out.println(x);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
